package com.swt.shoppingmall.utils;

/**
 * Created by swt on 2016/12/24.
 */

public class CommonUtils {

    private static CommonUtils instance;

    private CommonUtils() {
    }

    public static CommonUtils getInstance() {
        if (instance == null) {
            instance = new CommonUtils();
        }
        return instance;
    }

    /**
     * 格式化字符串 保留两位小数
     *
     * @param d
     * @return
     */
    public String doubleFormat(double d) {
        return String.format("%.2f", d);
    }
}
